package br.com.fiap.goaround.scheduler;

import java.util.Date;
import java.util.logging.Logger;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import br.com.fiap.goaround.bo.TrafficBO;
import br.com.fiap.goaround.to.TrafficTO;

public class UpdateTrafficJob implements Job{

	private static final Logger log = Logger.getLogger("Atualizando base de dados",UpdateTrafficJob.class.getName());  
	
	@Override
	public void execute(JobExecutionContext arg0) throws JobExecutionException {
		log.info("Inicio Update: "+ new Date());
		TrafficBO bo = new TrafficBO();
		try {
			bo.updateBase();
		} catch (Exception e) {
			log.severe("Problema ao atualizar a Base: "+ e.getMessage());
		}
		log.info("Fim Update: "+ new Date());
	}

}
